<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.io.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Insert title here</title>
	</head>
	<body>
		<%
			try {
				final String ACCESIBLE_FILES_PATH = "/WEB-INF/";
				ServletContext sc = getServletContext();
				String ruta = sc.getRealPath(ACCESIBLE_FILES_PATH) + File.separator;
				
			   String filename = ruta + "62 modelo para armar.txt";
			
			   // set the http content type to "APPLICATION/OCTET-STREAM
			   response.setContentType("APPLICATION/OCTET-STREAM");
			
			   // initialize the http content-disposition header to
			   // indicate a file attachment with the default filename
			   // "myFile.txt"
			   String disHeader = "Attachment;Filename=\"62 modelo para armar.txt\"";
			   response.setHeader("Content-Disposition", disHeader);
			
			   // transfer the file byte-by-byte to the response object
			   File fileToDownload = new File(filename);
			   FileInputStream fileInputStream = new FileInputStream(fileToDownload);
			   int i;
			   while ((i=fileInputStream.read())!=-1)
			   {
			      out.write(i);
			   }
			   fileInputStream.close();
			   out.close();
			   }catch(Exception e) // file IO errors
			   {
			   e.printStackTrace();
			}
		%>
</body>
</html>